import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-10-17
 * Time: 21:37
 */
public class test_3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            StringBuffer ret = new StringBuffer();
            String string = in.nextLine();
            int n = string.length() - 1;
            int front = n;
            int behind = n;
            int flag=1;
            while (front >= 0) {
                if (string.charAt(front) == ' ' ) {
                    if (flag==1){
                        behind++;
                        flag=0;
                    }
                    ret.append(string.substring(front + 1, behind) + ' ');
                    behind = front;
                }
                if (front == 0) {
                    ret.append(string.substring(front, behind));
                }
                front--;
            }
            System.out.println(ret);
        }
    }
}
